<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs for page hackystatUpload.php</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="file-name"><img src="../media/images/Page_logo.png" alt="File" style="vertical-align: middle">/hackystatUpload.php</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
									<a href="#sec-includes">Includes</a>
			|											<a href="#sec-functions">Functions</a>
			</div>
	<div class="info-box-body">	
		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">File: hackystatUpload.php</p>
<p class="description"><p>This PHP script is used to retrieve and parse user data from the Hackystat server  and store it into iHacky database.  This script takes a long time to run depending  on the amount Hackystat data from the users.  The script has two phases, one is to  serve users that are new to the iHacky database and the other is for users that  already have data in the iHacky database.  The reason for this is to minimize overhead.</p><p>The script's algorithm works as follow:  -Retrieve iHacky user's Hackystat login info, if they exist.  -Check if the user is new to iHacky or not.  ---If new, then grab data from past 50 days. (set by dayCounter)  ---If old, then grab data for past 1 day.  -Invoke Hackystat server URIs to retrieve DevEvent data for the user.  -Store the filename attribute of the URI result into a map. (used to determine related class)  ---Count the number of times the filename repeated (used to calculate rank)  -Invoke Hackystat server URIs to retrieve Coupling data for the user.  -Store the filename and class info from the URI result into a map.  -Compare the two maps to see if there is a match in filenames.  ---If yes, then grab the repeat count and use that number to calculate rank.  ------Store that rank into that user's class data.  ---------If that class is new then add to the Class table in the database            and reference that user with it.  ---------If the class exist then replace the Rank calculated with the current rank            in the database.  ---If no, then neglect the data because there is no Coupling data for that filename.  -First used and Last used time from the Coupling data is also stored into the database    for the user.  -Repeat the process for the next user in the database.  Ends algorithm</p><p>This script is planned to be invoked once per day on the same time. Use the web server's  CRON Job feature to invoke this script.  If the script successfully completes it will print out &quot;Success&quot;.</p><p>Formula for the Rank:  -DevEvent occurence -Rank <ol><li>to 10          1</li></ol>       50 to 100        2        100 to 150       3        150 to 200       4        200 and above    5</p></p>
		
			</div>
</div>
		

	<a name="sec-includes"></a>	
	<div class="info-box">
		<div class="info-box-title">Includes</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
						<span class="disabled">Includes</span>
			|													<a href="#sec-functions">Functions</a>
					</div>
		<div class="info-box-body">	
			<a name="_iHackyFunctions_php"><!-- --></a>
<div class="oddrow">
	
	<div>
		<img src="../media/images/Page.png" alt=" " />
		<span class="include-title">
			<span class="include-type">include</span>
			(<span class="include-name"><a href="../default/_iHackyFunctions.php.html">'iHackyFunctions.php'</a></span>)
			(line <span class="line-number">54</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
</div>
<a name="_lib/config_php"><!-- --></a>
<div class="evenrow">
	
	<div>
		<img src="../media/images/Page.png" alt=" " />
		<span class="include-title">
			<span class="include-type">include</span>
			(<span class="include-name"><a href="../default/_lib---config.php.html">'lib/config.php'</a></span>)
			(line <span class="line-number">55</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
</div>
<a name="_getXMLData_php"><!-- --></a>
<div class="oddrow">
	
	<div>
		<img src="../media/images/Page.png" alt=" " />
		<span class="include-title">
			<span class="include-type">include</span>
			(<span class="include-name"><a href="../default/_getXMLData.php.html">'getXMLData.php'</a></span>)
			(line <span class="line-number">56</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
</div>
		</div>
	</div>
	
	
	
	<a name="sec-functions"></a>	
	<div class="info-box">
		<div class="info-box-title">Functions</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
										<a href="#sec-includes">Includes</a>
				|												<span class="disabled">Functions</span>
		</div>
		<div class="info-box-body">	
			<a name="functiondb_insertClass_Users" id="functiondb_insertClass_Users"><!-- --></a>
<div class="evenrow">
	
	<div>
		<img src="../media/images/Function.png" />
		<span class="method-title">db_insertClass_Users</span> (line <span class="line-number">338</span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
	<div class="method-signature">
		<span class="method-result">unknown</span>
		<span class="method-name">
			db_insertClass_Users
		</span>
					(<span class="var-type">unknown_type</span>&nbsp;<span class="var-name">$conn</span>, <span class="var-type">unknown_type</span>&nbsp;<span class="var-name">$facebookID</span>, <span class="var-type">unknown_type</span>&nbsp;<span class="var-name">$classID</span>, <span class="var-type">unknown_type</span>&nbsp;<span class="var-name">$startDate</span>, <span class="var-type">unknown_type</span>&nbsp;<span class="var-name">$lastDate</span>, <span class="var-type">unknown_type</span>&nbsp;<span class="var-name">$usedDate</span>, <span class="var-type">unknown_type</span>&nbsp;<span class="var-name">$rank</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">unknown_type</span>
				<span class="var-name">$conn</span>			</li>
					<li>
				<span class="var-type">unknown_type</span>
				<span class="var-name">$facebookID</span>			</li>
					<li>
				<span class="var-type">unknown_type</span>
				<span class="var-name">$classID</span>			</li>
					<li>
				<span class="var-type">unknown_type</span>
				<span class="var-name">$startDate</span>			</li>
					<li>
				<span class="var-type">unknown_type</span>
				<span class="var-name">$lastDate</span>			</li>
					<li>
				<span class="var-type">unknown_type</span>
				<span class="var-name">$usedDate</span>			</li>
					<li>
				<span class="var-type">unknown_type</span>
				<span class="var-name">$rank</span>			</li>
				</ul>
		
	
</div>
<a name="functiondb_updateCron_Jobs" id="functiondb_updateCron_Jobs"><!-- --></a>
<div class="oddrow">
	
	<div>
		<img src="../media/images/Function.png" />
		<span class="method-title">db_updateCron_Jobs</span> (line <span class="line-number">372</span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Enter description here...</p>
	<div class="method-signature">
		<span class="method-result">unknown</span>
		<span class="method-name">
			db_updateCron_Jobs
		</span>
					(<span class="var-type">unknown_type</span>&nbsp;<span class="var-name">$conn</span>, <span class="var-type">unknown_type</span>&nbsp;<span class="var-name">$cronjobName</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">unknown_type</span>
				<span class="var-name">$conn</span>			</li>
					<li>
				<span class="var-type">unknown_type</span>
				<span class="var-name">$cronjobName</span>			</li>
				</ul>
		
	
</div>
<a name="functionparseDependencyFilename" id="functionparseDependencyFilename"><!-- --></a>
<div class="evenrow">
	
	<div>
		<img src="../media/images/Function.png" />
		<span class="method-title">parseDependencyFilename</span> (line <span class="line-number">388</span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Enter description here...</p>
	<div class="method-signature">
		<span class="method-result">unknown</span>
		<span class="method-name">
			parseDependencyFilename
		</span>
					(<span class="var-type">unknown_type</span>&nbsp;<span class="var-name">$string</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">unknown_type</span>
				<span class="var-name">$string</span>			</li>
				</ul>
		
	
</div>
<a name="functionparseDevEventFilename" id="functionparseDevEventFilename"><!-- --></a>
<div class="oddrow">
	
	<div>
		<img src="../media/images/Function.png" />
		<span class="method-title">parseDevEventFilename</span> (line <span class="line-number">399</span>)
	</div> 

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Enter description here...</p>
	<div class="method-signature">
		<span class="method-result">unknown</span>
		<span class="method-name">
			parseDevEventFilename
		</span>
					(<span class="var-type">unknown_type</span>&nbsp;<span class="var-name">$string</span>)
			</div>

			<ul class="parameters">
					<li>
				<span class="var-type">unknown_type</span>
				<span class="var-name">$string</span>			</li>
				</ul>
		
	
</div>
		</div>
	</div>
	
	<p class="notes" id="credit">
		Documentation generated on Tue, 13 May 2008 02:22:18 -1000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
	</p>
	</div></body>
</html>